﻿using System;
using System.Windows;

namespace ImageControl.ViewModels.Handlers
{
    public class TopCenterHandler : HandlerViewModel
    {
        public TopCenterHandler(AdornerViewModel adorner)
            : base(adorner)
        {
        }

        public override void HandleMove(Point coordinate)
        {
            double orientedHeight, rotatedCenterY;
            this.HandleTopMove(coordinate, out orientedHeight, out rotatedCenterY);
            double orientedWidth = this.Adorner.ImageModel.OrientedWidth;
            double rotatedCenterX = orientedWidth / 2;

            this.HandleMove(orientedWidth, orientedHeight, rotatedCenterX, rotatedCenterY);
        }
    }
}